package cn.com.zzl.test;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.com.zzl.po.User;
import cn.com.zzl.util.CalendarUtil;

/**
 * @description TODO
 * @author rambo
 * @date 2018年5月14日 上午11:20:59
 */
public class My {

	/**
	 * @description TODO
	 * @param args
	 */
	/*public static void main(String[] args) {
//		String str = "1,2,3,,,,,";
//		String[] array = str.split(",");
//		System.out.println(array.length);//3
		
		List<Integer> list = new ArrayList<Integer>();
		
		list.add(1);
		list.add(2);
		list.add(3);
		list.add(4);
		
		//Integer[] list2Array = list2Array(list);
		
		//System.out.println(list2Array[0]);
		
	}*/
	
	
	/*public static void main(String[] args) {
		User user = new User();
		user.setUsername("张三");
		add_1(user);
		System.out.println(user.getUsername());
	}
	
	public static void add_1(User user) {
		user.setUsername("李四");
	}*/
	
	public static void main(String[] args) {
		
		//String、byte、short、int、         long、float、double、char、             boolean、BigDecimal
		//String、Byte、Short、Integer、Long、Float、Double、Character、Boolean、BigDecimal
		
		Object o_1 = "12345";
		System.out.println(o_1);//12345
		System.out.println(o_1.toString());//12345
		
		Object o_2 = 12345678;
		System.out.println(o_2);//12345678
		System.out.println(o_2.toString());//12345678
		
		Object o_3 = true;
		System.out.println(o_3);//true
		System.out.println(o_3.toString());//true
		
		Object o_4 = 12.34f;
		System.out.println(o_4);//12.34
		System.out.println(o_4.toString());//12.34
		
		Object o_5 = 12.88d;
		System.out.println(o_5);//12.88
		System.out.println(o_5.toString());//12.88
		
		Object o_6 = new Character('1');
		System.out.println(o_6);//1
		System.out.println(o_6.toString());//1
		
		Object o_7 = (long)1234;
		System.out.println(o_7);//1234
		System.out.println(o_7.toString());//1234
		
		Object o_8 = (short) 12;
		System.out.println(o_8);//12
		System.out.println(o_8.toString());//12
		
		Object o_9 = (byte) 123;
		System.out.println(o_9);//123
		System.out.println(o_9.toString());//123
		
		Object o_10 = new BigDecimal(987654321);
		System.out.println(o_10);//987654321
		System.out.println(o_10.toString());//987654321
		
		Date o_11 = new Date();
		System.out.println(CalendarUtil.dateToString(o_11));
		System.out.println(CalendarUtil.dateToString(o_11, "yyyy-MM-dd"));
		System.out.println(CalendarUtil.dateToString(o_11, "HH:mm:ss"));
		
		Object o_12 = new Integer[]{1, 2, 3};
		System.out.println(o_12);//[Ljava.lang.Integer;@2da8c22b
		System.out.println(o_12.toString());//[Ljava.lang.Integer;@2da8c22b
	}
	
}
